﻿# 依赖vtkm
cmake_minimum_required(VERSION 3.8)
project(framework)

find_package(ParaView REQUIRED)
find_package(VTKm REQUIRED QUIET)
find_package(VTK COMPONENTS
IOIOSS
FiltersGeneral
AcceleratorsVTKmDataModel
REQUIRED)

set(target ${project_name})

set(headers
)

set(template_sources
)

set(host_src
main.cpp

parser/Configuration.cpp

application/Application.cpp
application/MDApplication.cpp

action/Action.cpp
action/CreateMeshAction.cpp
action/CreateSystemAction.cpp
action/AddBCAction.cpp
action/CreateExecutioner.cpp
action/AddOutput.cpp
action/AddUserObject.cpp
action/SetupDeviceAction.cpp

executioner/Executioner.cpp
executioner/Transient.cpp

#meshmodifier/MeshModifier.cpp
#meshmodifier/Transform.cpp
#meshmodifier/BoundingBoxSubBlock.cpp

mesh/Mesh.cpp
#mesh/FileMesh.cpp
mesh/GeneratedMesh.cpp
#mesh/UnstructuredMesh.cpp
#mesh/OverlapMesh.cpp
#
output/Output.cpp
output/FileOutput.cpp
output/VTKOutput.cpp
##output/MultiVTKOutput.cpp
#
#userobject/UserObject.cpp
##userobject/RemapUserObject.cpp
#
system/System.cpp
#system/EulerEquation.cpp
#system/ForwardStep.cpp
#system/IsoVortex.cpp

)
set(device_src
mesh/MeshTool.cpp
system/MadelungSystem.cpp
system/LennardJonesSystem.cpp
cont/PointLocatorSparseGrid.cxx
 
#system/worklet/EquationSet.cpp
#system/worklet/ComputeResidual.cpp
#system/worklet/InitialCondition.cpp
#system/worklet/MeshModifier.cpp
#system/HeatConductionSystem.cpp

#system/MultiSystem.cpp
#system/CoutteFlow.cpp
##system/Riemann2D.cpp
#system/DoubleMachReflection.cpp
#system/PassFlow.cpp
#
#system/NavierStokesEquation.cpp
#system/Plate2D.cpp
#system/CavityDriven.cpp
#system/SGHSystem.cpp
#system/SodSystem.cpp
#system/TaylorGreenVortex.cpp
#system/OrszagTangVortex.cpp

)

# 定义target
add_executable(${target} ${host_src} ${device_src})

# 头文件引入
add_library(_compiler_flags INTERFACE)
target_include_directories(_compiler_flags INTERFACE
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/action
  ${CMAKE_CURRENT_SOURCE_DIR}/application
  ${CMAKE_CURRENT_SOURCE_DIR}/executioner
  ${CMAKE_CURRENT_SOURCE_DIR}/mesh
  ${CMAKE_CURRENT_SOURCE_DIR}/meshmodifier
  ${CMAKE_CURRENT_SOURCE_DIR}/output
  ${CMAKE_CURRENT_SOURCE_DIR}/parser
  ${CMAKE_CURRENT_SOURCE_DIR}/system
  ${CMAKE_CURRENT_SOURCE_DIR}/userobject
  )


target_link_libraries(${target} PUBLIC _compiler_flags )

#加载 VTK-m 
target_link_libraries(${target} PUBLIC vtkm_filter vtkm_cont vtkm_worklet vtkm_io)
#target_link_libraries(${target} PRIVATE ${VTK_LIBRARIES})
target_link_libraries(${target} 
PRIVATE fmt::fmt
PRIVATE getpot
)

vtkm_add_target_information(${target} DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS DEVICE_SOURCES ${device_src})





